package com.test.learnopenglandroid.chapter4advancedopengl;

import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import com.test.learnopenglandroid.UIHelper;

public class Chapter4 {
    public static void init(LinearLayout chapterRoot, final LinearLayout buttonRoot, FrameLayout renderRoot){
        final LinearLayout btnRoot = buttonRoot;
        final FrameLayout frenderRoot = renderRoot;
        UIHelper.addTest(chapterRoot,"第四章 高级OpenGL",new View.OnClickListener(){

            @Override
            public void onClick(View view) {
                btnRoot.removeAllViews();
                addAllTest(btnRoot,frenderRoot);
            }
        });
    }

    static private void addAllTest(LinearLayout buttonRoot,FrameLayout renderRoot){
        UIHelper.addTest(buttonRoot,"深度测试",
                new Test1DepthTest(renderRoot.getContext(),renderRoot,
                        Test1DepthTest.TestType.GLES20RendererDepthTest));
        UIHelper.addTest(buttonRoot,"帧缓冲",
                new Test5FrameBufferTest(renderRoot.getContext(),renderRoot,
                        Test5FrameBufferTest.TestType.GLES20FrameBufferTest));
        UIHelper.addTest(buttonRoot,"帧缓冲+FXAA",
                new Test5FrameBufferTest(renderRoot.getContext(),renderRoot,
                        Test5FrameBufferTest.TestType.GLES20FrameBufferFXAATest));
    }
}